<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<jsp:useBean id="person" class="com.imooc.test.Person"></jsp:useBean>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'set.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <!-- 存值到scope中 -->
    <c:set value="today" var="day" scope="session"></c:set>
    <c:out value="${day}"></c:out><br>
    
    <c:set var="age" scope="session">ten</c:set>
    <c:out value="${age}"></c:out><br>
    
    <!-- 存值到javabean属性中 -->
    <!-- 通过set标签向person中赋值 -->
    <c:set target="${person}" property="name" value="张三"></c:set>
    <c:out value="${person.name }"></c:out>&nbsp;&nbsp;
    
    <c:set target="${person}" property="age" value="23"></c:set>
    <c:out value="${person.age }"></c:out>&nbsp;&nbsp;
    
    <c:set target="${person}" property="address" value="武汉市 江夏区"></c:set>
    <c:out value="${person.address }"></c:out><br>
  </body>
</html>
